/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.restaurant.domain;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author root
 */
@Entity
@Table(name = "tax")
@XmlRootElement(name = "tex")
@NamedQueries({
    @NamedQuery(name = "Tax.findAll", query = "SELECT t FROM Tax t"),
    @NamedQuery(name = "Tax.findByTaxID", query = "SELECT t FROM Tax t WHERE t.taxID = :taxID"),
    @NamedQuery(name = "Tax.findByDescription", query = "SELECT t FROM Tax t WHERE t.description = :description"),
    @NamedQuery(name = "Tax.findByTaxpercentage", query = "SELECT t FROM Tax t WHERE t.taxpercentage = :taxpercentage"),
    @NamedQuery(name = "Tax.findByIsdeleted", query = "SELECT t FROM Tax t WHERE t.isdeleted = :isdeleted")})
public class Tax implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "TaxID")
    private Long taxID;
    @Column(name = "description")
    private String description;
    @Column(name = "taxpercentage")
    private Float taxpercentage;
    @Column(name = "isdeleted")
    private Boolean isdeleted;
    @JoinColumn(name = "taxtype_TaxTypeID", referencedColumnName = "TaxTypeID")
    @ManyToOne(optional = false)
    private Taxtype taxtype;

    public Tax() {
    }

    public Tax(Long taxID) {
        this.taxID = taxID;
    }

    public Long getTaxID() {
        return taxID;
    }

    public void setTaxID(Long taxID) {
        this.taxID = taxID;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Float getTaxpercentage() {
        return taxpercentage;
    }

    public void setTaxpercentage(Float taxpercentage) {
        this.taxpercentage = taxpercentage;
    }

    public Boolean getIsdeleted() {
        return isdeleted;
    }

    public void setIsdeleted(Boolean isdeleted) {
        this.isdeleted = isdeleted;
    }

    public Taxtype getTaxtype() {
        return taxtype;
    }

    public void setTaxtype(Taxtype taxtype) {
        this.taxtype = taxtype;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (taxID != null ? taxID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Tax)) {
            return false;
        }
        Tax other = (Tax) object;
        if ((this.taxID == null && other.taxID != null) || (this.taxID != null && !this.taxID.equals(other.taxID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.restaurant.domain.Tax[taxID=" + taxID + "]";
    }

}
